<template>
  <div class="app-container">
    <Ht-search-form
      v-show="showSearch"
      :advOptions="[]"
      :dictMap="dictMap"
      :formOptions="formOptions"
      :outputQueryParams="queryParams"
      :queryParams="queryParams"
      :defaultEventKey="defaultEventKey"
      :labelWidth="75"
    ></Ht-search-form>

    <ht-table
      :defaultEventKey="defaultEventKey"
      ref="dataTable"
      :dictMap="dictMap"
      :multi-select="false"
      :opButtonList="opButtonList"
      :queryParams="queryParams"
      :reqConfig="regConfig"
      :showSerialNumber="false"
      :tableBindColumns="tableBindColumns"
    >
      <template v-slot:operate>
        <el-table-column align="left" fixed="right" label="操作" width="120">
          <template slot-scope="scope">
            <ht-button-group
              :buttonList="[
                {
                  label: '明细',
                  doFunc: () => {
                    handleAction('detail', scope.row);
                  },
                },
                {
                  label: '应答明细',
                  visible: scope.row.retId !== undefined,
                  doFunc: () => {
                    resDetail(scope.row);
                  },
                },
              ]"
            />
          </template>
        </el-table-column>
      </template>
    </ht-table>

    <!-- 添加或修改弹出框 -->
    <el-dialog
      :close-on-click-modal="false"
      :title="title"
      center
      :visible.sync="open"
      v-if="open"
      append-to-body
      width="1024px"
    >
      <el-form ref="detailForm" :model="detailForm" label-width="140px">
        <el-card class="form-card txnInfo-card">
        <div slot="header" class="label-header-msg">
          <span>基本信息</span>
        </div>

        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="交易流水号" prop="id">
              <el-input v-model="detailForm.id" :disabled="true" />
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="报文标识号" prop="pkgId">
              <el-input v-model="detailForm.pkgId" :disabled="true" />
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="批序号" prop="batchNo">
              <el-input v-model="detailForm.batchNo" :disabled="true" />
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="CPG日期" prop="cpgdate">
              <el-date-picker
                v-model="detailForm.cpgdate"
                style="width: 100%"
                type="date"
                value-format="yyyyMMdd"
                :disabled="true"
              />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="工作日期" prop="workdate">
              <el-date-picker
                v-model="detailForm.workdate"
                style="width: 100%"
                type="date"
                value-format="yyyyMMdd"
                :disabled="true"
              />
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="来往账标识" prop="drct">
              <el-select style="width: 100%" v-model="detailForm.drct" placeholder="来往账标识" :disabled="true">
                <el-option
                  v-for="dict in dictMap.DRCTCODE"
                  :key="dict.value"
                  :label="`${dict.value}-${dict.text}`"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="原业务类型" prop="bizTypeCode">
              <el-select
                style="width: 100%"
                v-model="
                  detailForm.bizTypeCode === null || detailForm.bizTypeCode === undefined
                    ? ''
                    : detailForm.bizTypeCode + '-' + detailForm.bizTypeCodeDesc
                "
                placeholder="原业务类型"
                :disabled="true"
              ></el-select>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="货币种类" prop="curcd">
              <el-input v-model="detailForm.curcd" :disabled="true" />
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="总金额" prop="totAmount">
              <ht-amount-input v-model="detailForm.totAmount" placeholder="总金额" :disable="true"></ht-amount-input>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="付款人数目" prop="payerNum">
              <el-input v-model="detailForm.payerNum" :disabled="true" />
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="回执期限" prop="returnDate">
              <el-input v-model="detailForm.returnDate" :disabled="true" />
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="转发日期" prop="npcSndDate">
              <el-date-picker
                v-model="detailForm.npcSndDate"
                style="width: 100%"
                type="date"
                value-format="yyyyMMdd"
                :disabled="true"
              />
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="付款方动账标识" prop="payerAccChgFlg">
              <el-select
                style="width: 100%"
                v-model="detailForm.payerAccChgFlg"
                placeholder="付款方动账标识"
                :disabled="true"
              >
                <el-option
                  v-for="dict in dictMap.Acc_Chg_Flg_Code"
                  :key="dict.value"
                  :label="`${dict.value}-${dict.text}`"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="扣款通知编号" prop="dbtNo">
              <el-input v-model="detailForm.dbtNo" :disabled="true" />
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="收款方动账标识" prop="payeeAccChgFlg">
              <el-select
                style="width: 100%"
                v-model="detailForm.payeeAccChgFlg"
                placeholder="收款方动账标识"
                :disabled="true"
              >
                <el-option
                  v-for="dict in dictMap.Acc_Chg_Flg_Code"
                  :key="dict.value"
                  :label="`${dict.value}-${dict.text}`"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="入账通知编号" prop="crdNo">
              <el-input v-model="detailForm.crdNo" :disabled="true" />
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="统一社会信用代码" prop="uniformScCode">
              <el-input v-model="detailForm.uniformScCode" :disabled="true" />
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="地域标识" prop="regionid">
              <el-select
                style="width: 100%"
                v-model="
                  detailForm.regionid === null || detailForm.regionid === undefined
                    ? ''
                    : detailForm.regionid + '-' + detailForm.regionidDesc
                "
                placeholder="地域标识"
                :disabled="true"
              ></el-select>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="征收机关代码" prop="orgId">
              <el-input v-model="detailForm.orgId" :disabled="true" />
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="征收机关提交日期" prop="orgCmDate">
              <el-date-picker
                v-model="detailForm.orgCmDate"
                style="width: 100%"
                type="date"
                value-format="yyyyMMdd"
                :disabled="true"
              />
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="凭证种类代码" prop="cfTypeCode">
              <el-input v-model="detailForm.cfTypeCode" :disabled="true" />
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="交易种类" prop="tradeType">
              <el-input v-model="detailForm.tradeType" :disabled="true" />
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="凭证编号" prop="cfNo">
              <el-input v-model="detailForm.cfNo" :disabled="true" />
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="凭证名称" prop="cfName">
              <el-input v-model="detailForm.cfName" :disabled="true" />
            </el-form-item>
          </el-col>
        </el-row>
        </el-card>
        <el-card class="form-card txnInfo-card">
          <div slot="header" class="label-header-msg">
            <span>收款人信息</span>
          </div>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="收款行行号" prop="payeeBrno">
                <el-input v-model="detailForm.payeeBrno" :disabled="true" />
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="收款行行名" prop="payeeBrname">
                <el-input v-model="detailForm.payeeBrname" :disabled="true" />
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="收款清算行行号" prop="payeeStBrno">
                <el-input v-model="detailForm.payeeStBrno" :disabled="true" />
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="收款清算行行名" prop="payeeStBrname">
                <el-input v-model="detailForm.payeeStBrname" :disabled="true" />
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="收款人账号" prop="payeeActno">
                <el-input v-model="detailForm.payeeActno" :disabled="true" />
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="收款人名称" prop="payeeName">
                <el-input v-model="detailForm.payeeName" :disabled="true" />
              </el-form-item>
            </el-col>
          </el-row>
          <div class="discountReceipt-pick-operate-box">
            <div class="operate-box-bottom">
              <div class="bottom-content">
            <ht-table
              ref="dataTable"
              :multi-select="false"
              :showSerialNumber="false"
              :dictMap="dictMap"
              :queryParams="queryDetailParams"
              :tableBindColumns="tableBindDetailColumns"
              :opButtonList="opButtonList"
              :reqConfig="regConfigDetail"
            >
              <template v-slot:operate>
                <el-table-column align="left" fixed="right" label="操作" width="120">
                  <template slot-scope="scope">
                    <ht-button-group
                      :buttonList="[
                        {
                          label: '明细',
                          doFunc: () => {
                            payerDetail(scope.row);
                          },
                        },
                      ]"
                    />
                  </template>
                </el-table-column>
              </template>
            </ht-table>
              </div>
            </div>
          </div>
          <el-row type="flex">
            <el-col :span="24">
              <el-form-item label="备注" prop="remarks">
                <el-input type="textarea" v-model="detailForm.remarks" :disabled="true" />
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="中心状态" prop="procStatus">
                <el-select style="width: 100%" v-model="detailForm.procStatus" placeholder="中心状态" :disabled="true">
                  <el-option
                    v-for="dict in dictMap.PROCESSSTATUS"
                    :key="dict.value"
                    :label="`${dict.value}-${dict.text}`"
                    :value="dict.value"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="通讯状态" prop="status">
                <el-select style="width: 100%" v-model="detailForm.status" placeholder="通讯状态" :disabled="true">
                  <el-option
                    v-for="dict in dictMap.PKG_STATUS"
                    :key="dict.value"
                    :label="`${dict.value}-${dict.text}`"
                    :value="dict.value"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="接收时间" prop="rcvTime">
                <el-date-picker
                  style="width: 100%"
                  v-model="detailForm.rcvTime"
                  value-format="yyyyMMddHHmmss"
                  type="datetime"
                  :disabled="true"
                />
              </el-form-item>
            </el-col>
          </el-row>
        </el-card>
      </el-form>

      <div slot="footer" align="center" class="dialog-footer">
        <el-button type="primary" @click="cancel">关 闭</el-button>
      </div>
    </el-dialog>

    <el-dialog
      :close-on-click-modal="false"
      :title="restitle"
      :visible.sync="resopen"
      v-if="resopen"
      append-to-body
      center
      width="1024px"
    >
      <el-form ref="resdetailForm" :model="resdetailForm" label-width="140px">
        <div slot="header" class="label-header-msg">
          <span></span>
        </div>
        <el-card class="form-card txnInfo-card">
          <div slot="header" class="label-header-msg">
            <span>基本信息</span>
          </div>
          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="交易流水号" prop="id">
                <el-input v-model="resdetailForm.id" :disabled="true"/>
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="报文标识号" prop="pkgId">
                <el-input v-model="resdetailForm.pkgId" :disabled="true"/>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="CPG日期" prop="cpgdate">
                <el-date-picker
                  :disabled="true"
                  v-model="resdetailForm.cpgdate"
                  style="width: 100%"
                  type="date"
                  value-format="yyyyMMdd"
                />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="CPG日期" prop="workdate">
                <el-date-picker
                  :disabled="true"
                  v-model="resdetailForm.workdate"
                  style="width: 100%"
                  type="date"
                  value-format="yyyyMMdd"
                />
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="来往账标识" prop="drct">
                <el-select style="width: 100%" v-model="resdetailForm.drct" placeholder="来往账标识" :disabled="true">
                  <el-option
                    v-for="dict in dictMap.DRCTCODE"
                    :key="dict.value"
                    :label="`${dict.value}-${dict.text}`"
                    :value="dict.value"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="货币种类" prop="sucCurcd">
                <el-input v-model="resdetailForm.sucCurcd" :disabled="true"/>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="成功总金额" prop="sucAmount">
                <ht-amount-input
                  v-model="resdetailForm.sucAmount"
                  :disabled="true"
                  placeholder="成功总金额"
                  :disable="true"
                ></ht-amount-input>
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="成功总笔数" prop="sucNumber">
                <el-input v-model="resdetailForm.sucNumber" :disabled="true"/>
              </el-form-item>
            </el-col>
          </el-row>
        </el-card>

        <el-card class="form-card txnInfo-card">
          <div slot="header" class="label-header-msg">
            <span>原交易信息</span>
          </div>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="原交易流水号" prop="oriId">
                <el-input v-model="resdetailForm.oriId" :disabled="true"/>
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="原报文标识号" prop="oriPkgId">
                <el-input v-model="resdetailForm.oriPkgId" :disabled="true"/>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="原批序号" prop="oriBatchNo">
                <el-input v-model="resdetailForm.oriBatchNo" :disabled="true"/>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="原转发日期" prop="oriNpcSndDate">
                <el-date-picker
                  :disabled="true"
                  v-model="resdetailForm.oriNpcSndDate"
                  style="width: 100%"
                  type="date"
                  value-format="yyyyMMdd"
                />
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="原回执期限" prop="oriReturnDate">
                <el-input v-model="resdetailForm.oriReturnDate" :disabled="true"/>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="货币种类" prop="oriCurcd">
                <el-input v-model="resdetailForm.oriCurcd" :disabled="true"/>
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="原总金额" prop="oriTotAmount">
                <ht-amount-input
                  v-model="resdetailForm.oriTotAmount"
                  placeholder="原总金额"
                  :disable="true"
                ></ht-amount-input>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="原总笔数" prop="oriTotNumber">
                <el-input v-model="resdetailForm.oriTotNumber" :disabled="true"/>
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="原业务类型" prop="oriBizTypeCode">
                <el-select
                  style="width: 100%"
                  v-model="
                    resdetailForm.oriBizTypeCode === null || resdetailForm.oriBizTypeCode === undefined
                      ? ''
                      : resdetailForm.oriBizTypeCode + '-' + resdetailForm.oriBizTypeCodeDesc
                  "
                  placeholder="原业务类型"
                  :disabled="true"
                ></el-select>
              </el-form-item>
            </el-col>
          </el-row>
        </el-card>

        <el-card class="form-card txnInfo-card">
          <div slot="header" class="label-header-msg">
            <span>收款方信息</span>
          </div>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="收款行行号" prop="payeeBrno">
                <el-input v-model="resdetailForm.payeeBrno" :disabled="true"/>
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="收款行行名" prop="payeeBrname">
                <el-input v-model="resdetailForm.payeeBrname" :disabled="true"/>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="收款人账号" prop="payeeActno">
                <el-input v-model="resdetailForm.payeeActno" :disabled="true"/>
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="收款人名称" prop="payeeName">
                <el-input v-model="resdetailForm.payeeName" :disabled="true"/>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="原收款方统一社会信用代码" prop="orgUniformScCode">
                <el-input v-model="resdetailForm.orgUniformScCode" :disabled="true"/>
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="原地域标识" prop="orgRegionid">
                <el-select
                  style="width: 100%"
                  v-model="
                    resdetailForm.orgRegionid === null || resdetailForm.orgRegionid === undefined
                      ? ''
                      : resdetailForm.orgRegionid + '-' + resdetailForm.orgRegionidDesc
                  "
                  placeholder="原地域标识"
                  :disabled="true"
                ></el-select>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="原收款方动账标识" prop="orgPayeeAccChgFlg">
                <el-select style="width: 100%" :disabled="true" v-model="resdetailForm.orgPayeeAccChgFlg" placeholder="原收款方动账标识" :disable="true">
                  <el-option
                    v-for="dict in dictMap.Acc_Chg_Flg_Code"
                    :key="dict.value"
                    :label="`${dict.value}-${dict.text}`"
                    :value="dict.value"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="货币种类" prop="sucCurcd">
                <el-input v-model="resdetailForm.sucCurcd" :disabled="true"/>
              </el-form-item>
            </el-col>
          </el-row>
        </el-card>

        <el-card class="form-card txnInfo-card">
          <div slot="header" class="label-header-msg">
            <span>NPC处理信息</span>
          </div>
          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="处理码" prop="procCode">
                <el-select
                  style="width: 100%"
                  v-model="
                    resdetailForm.procCode === null || resdetailForm.procCode === undefined
                      ? ''
                      : resdetailForm.procCode + '-' + resdetailForm.procCodeDesc
                  "
                  placeholder="处理码"
                  :disabled="true"
                ></el-select>
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="拒绝信息" prop="rejectInfo">
                <el-input v-model="resdetailForm.rejectInfo" :disabled="true"/>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="轧差日期" prop="chkDate">
                <el-date-picker
                  v-model="resdetailForm.chkDate"
                  style="width: 100%"
                  type="date"
                  value-format="yyyyMMdd"
                  :disabled="true"
                />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="轧差场次" prop="chkRound">
                <el-input v-model="resdetailForm.chkRound" :disabled="true"/>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="清算日期" prop="clrDate">
                <el-date-picker
                  v-model="resdetailForm.clrDate"
                  style="width: 100%"
                  type="date"
                  value-format="yyyyMMdd"
                  :disabled="true"
                />
              </el-form-item>
            </el-col>
          </el-row>
          <div class="discountReceipt-pick-operate-box">
            <div class="operate-box-bottom">
              <div class="bottom-content">
           <ht-table
              ref="dataTable"
              :multi-select="false"
              :showSerialNumber="false"
              :dictMap="dictMap"
              :queryParams="resqueryDetailParams"
              :tableBindColumns="restableBindDetailColumns"
              :opButtonList="opButtonList"
              :reqConfig="resregConfigDetail"
            />
              </div>
            </div>
          </div>
          <el-row type="flex">
            <el-col :span="24">
              <el-form-item label="附言" prop="remarks">
                <el-input type="textarea" v-model="resdetailForm.remarks" :disabled="true"/>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="中心状态" prop="procStatus">
                <el-select
                  style="width: 100%"
                  v-model="resdetailForm.procStatus"
                  placeholder="中心状态"
                  :disabled="true"
                >
                  <el-option
                    v-for="dict in dictMap.PROCESSSTATUS"
                    :key="dict.value"
                    :label="`${dict.value}-${dict.text}`"
                    :value="dict.value"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="通讯状态" prop="status">
                <el-select :disable="true" :disabled="true" style="width: 100%" v-model="resdetailForm.status" placeholder="通讯状态">
                  <el-option
                    v-for="dict in dictMap.PKG_STATUS"
                    :key="dict.value"
                    :label="`${dict.value}-${dict.text}`"
                    :value="dict.value"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="发送时间" prop="sndTime">
                <el-date-picker
                  :disabled="true"
                  style="width: 100%"
                  v-model="resdetailForm.sndTime"
                  value-format="yyyyMMddHHmmss"
                  type="datetime"
                />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="接收时间" prop="rcvTime">
                <el-date-picker
                  style="width: 100%"
                  :disabled="true"
                  v-model="resdetailForm.rcvTime"
                  value-format="yyyyMMddHHmmss"
                  type="datetime"
                />
              </el-form-item>
            </el-col>
          </el-row>
        </el-card>
      </el-form>

      <div slot="footer" align="center" class="dialog-footer">
        <el-button type="primary" @click="rescancel">关 闭</el-button>
      </div>
    </el-dialog>

    <el-dialog
      :close-on-click-modal="false"
      :title="papertitle"
      :visible.sync="paperopen"
      v-if="paperopen"
      center
      append-to-body
      width="1024px"
    >
      <el-form ref="paperdetailForm" :model="paperdetailForm" label-width="140px" :disabled="true">
        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="明细标识号" prop="dtlNo">
              <el-input v-model="paperdetailForm.dtlNo" :disabled="true"/>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="付款行行号" prop="payerBrno">
              <el-input v-model="paperdetailForm.payerBrno" :disabled="true"/>
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="付款行行名" prop="payerBrname">
              <el-input v-model="paperdetailForm.payerBrname" :disabled="true"/>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="付款人账号" prop="payerActno">
              <el-input v-model="paperdetailForm.payerActno" :disabled="true"/>
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="付款人户名" prop="payerName">
              <el-input v-model="paperdetailForm.payerName" :disabled="true"/>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="业务种类" prop="bizCtgyCode">
              <el-select style="width: 100%" v-model="paperdetailForm.bizCtgyCode" placeholder="业务种类" :disabled="true">
                <el-option
                  v-for="dict in dictMap.BIZ_CTGY"
                  :key="dict.value"
                  :label="`${dict.value}-${dict.text}`"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="货币符号" prop="curcd">
              <el-input v-model="paperdetailForm.curcd" :disabled="true"/>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="金额" prop="amount">
              <ht-amount-input v-model="paperdetailForm.amount" placeholder="金额" :disable="true"></ht-amount-input>
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="协议号" prop="protoId">
              <el-input v-model="paperdetailForm.protoId" :disabled="true"/>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="核验标识" prop="checkId">
              <el-select style="width: 100%" v-model="paperdetailForm.checkId" placeholder="核验标识" :disabled="true">
                <el-option
                  v-for="dict in dictMap.CHECKFLAG"
                  :key="dict.value"
                  :label="`${dict.value}-${dict.text}`"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col :span="24">
            <el-form-item label="附言" prop="remarks">
              <el-input type="textarea" v-model="paperdetailForm.remarks" :disabled="true"/>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="付款客户标识" prop="payerId">
              <el-input v-model="paperdetailForm.payerId" :disabled="true"/>
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="收款人客户结算名称" prop="payeeInName">
              <el-input v-model="paperdetailForm.payeeInName" :disabled="true"/>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="收款人客户结算账号" prop="payeeInActno">
              <el-input v-model="paperdetailForm.payeeInActno" :disabled="true"/>
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="征收机关流水号" prop="orgNo">
              <el-input v-model="paperdetailForm.orgNo" :disabled="true"/>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="计费起始日期" prop="chgStDate">
              <el-date-picker
                :disable="true"
                v-model="paperdetailForm.chgStDate"
                style="width: 100%"
                type="date"
                value-format="yyyyMMdd"
              />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="计费截至日期" prop="chgEdDate">
              <el-date-picker
                :disable="true"
                v-model="paperdetailForm.chgEdDate"
                style="width: 100%"
                type="date"
                value-format="yyyyMMdd"
              />
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="缴费起始日期" prop="payStDate">
              <el-date-picker
                :disabled="true"
                v-model="paperdetailForm.payStDate"
                style="width: 100%"
                type="date"
                value-format="yyyyMMdd"
              />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="缴费截至日期" prop="payEdDate">
              <el-date-picker
                :disabled="true"
                v-model="paperdetailForm.payEdDate"
                style="width: 100%"
                type="date"
                value-format="yyyyMMdd"
              />
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="应付日期" prop="payDate">
              <el-date-picker
                :disable="true"
                v-model="paperdetailForm.payDate"
                style="width: 100%"
                type="date"
                value-format="yyyyMMdd"
              />
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="原金额币种" prop="orgCurcd">
              <el-input v-model="paperdetailForm.orgCurcd" :disable="true"/>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="原金额" prop="orgAmt">
              <ht-amount-input v-model="paperdetailForm.orgAmt" placeholder="金额" :disable="true"></ht-amount-input>
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="滞纳金币种" prop="delayCurcd">
              <el-input v-model="paperdetailForm.delayCurcd" :disable="true"/>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="滞纳金" prop="delayAmt">
              <ht-amount-input v-model="paperdetailForm.delayAmt" placeholder="金额" :disable="true"></ht-amount-input>
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="附加内容" prop="addInfo">
              <el-input v-model="paperdetailForm.addInfo" />
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <div slot="footer" align="center" class="dialog-footer">
        <el-button type="primary" @click="papercancel">关 闭</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import {
  apiUrlConfigQuery,
  apiUrlConfigQueryDetailTabSearch,
  apiUrlConfigQueryReplyDetailTab,
  batchCollectionBusinessQueryDetail,
  batchCollectionBusinessQueryPayerDetail,
  batchCollectionBusinessQueryReplyDetail,
} from "@/api/cnaps/beps/380";
import { listPageMixin } from "@/libs/listPageMixin";
import HtAmountInput from "@/views/components/HtAmountInput";
import { amountThousandsFormatter } from "@/utils/table_col_formatter";
import { stopPayAnswerQueryDetail } from "@/api/cnaps/beps/412";
export default {
  name: "BatchCollectionBusinessQuery",
  mixins: [listPageMixin],
  components: { HtAmountInput },
  data() {
    return {
      defaultEventKey: "defaultEventKey",
      // 查询参数
      queryParams: {
        startcpgdate: "",
        endcpgdate: "",
        startworkdate: "",
        endworkdate: "",
        id: "",
        payeeActno: "",
        batchNo: "",
      },
      queryDetailParams: {
        id: undefined,
      },
      resqueryDetailParams: {
        id: undefined,
      },
      // 搜索
      formOptions: [],
      //
      searchFormDictList: ["DRCTCODE", "Acc_Chg_Flg_Code", "PROCESSSTATUS", "PKG_STATUS","BIZ_CTGY","CHECKFLAG"],
      // 列信息
      regConfig: apiUrlConfigQuery,
      //明细表信息
      regConfigDetail: apiUrlConfigQueryDetailTabSearch,

      resregConfigDetail: apiUrlConfigQueryReplyDetailTab,

      tableBindColumns: [
        { prop: "id", label: "交易流水号", width: 180 },
        { prop: "cpgdate", label: "CPG日期", type: "date", width: 120 },
        { prop: "workdate", label: "工作日期", type: "date", width: 120 },
        { prop: "batchNo", label: "批序号", width: 120 },
        { prop: "payeeActno", label: "收款人账号", width: 180 },
        { prop: "totAmount", label: "总金额", type: "price", width: 120 },
        { prop: "status", label: "通讯状态", dictCode: "PKG_STATUS"},
      ],
      tableBindDetailColumns: [
        { prop: "dtlNo", label: "明细标识号", width: 120 },
        { prop: "payerActno", label: "付款人账号", width: 180 },
        { prop: "payerName", label: "付款人名称", width: 120 },
        {
          prop: "bizCtgyCode",
          label: "业务种类",
          formatter(row, text, index) {
            return (
              (row["bizCtgyCode"] === null || row["bizCtgyCode"] === undefined ? "" : row["bizCtgyCode"]) +
              "-" +
              (row["bizCtgyCodeDesc"] === null || row["bizCtgyCodeDesc"] === undefined ? "" : row["bizCtgyCodeDesc"])
            );
          },
          width: 120,
        },
        { prop: "payerBrno", label: "付款行行号", width: 120 },
        { prop: "payerBrname", label: "付款行行名", width: 120 },
        { prop: "protoId", label: "协议号", width: 120 },
        { prop: "amount", label: "金额", type: "price", width: 120 },
        { prop: "checkId", label: "核验标识", dictCode: "CHECKFLAG", width: 120 },
        { prop: "payerId", label: "付款客户标识", width: 120 },
        { prop: "payeeInName", label: "收款人客户结算名称", width: 180 },
        { prop: "payeeInActno", label: "收款人客户结算账号", width: 180 },
        { prop: "orgNo", label: "征收机关流水号", width: 180 },
        { prop: "chgStDate", label: "计费起始日期", width: 120 },
        { prop: "chgEdDate", label: "计费截至日期", width: 120 },
        { prop: "payStDate", label: "缴费起始日期", width: 120 },
        { prop: "payEdDate", label: "缴费截至日期", width: 120 },
        { prop: "payDate", label: "应付日期", width: 120 },
        { prop: "orgCurcd", label: "原金额币种", width: 120 },
        { prop: "orgAmt", label: "原金额", width: 120 },
        { prop: "delayCurcd", label: "滞纳金币种", width: 120 },
        { prop: "delayAmt", label: "滞纳金", width: 120 },
        { prop: "addInfo", label: "附加内容"},
      ],
      restableBindDetailColumns: [
        { prop: "payerId", label: "付款客户标识", width: 120 },
        { prop: "payerActno", label: "付款人账号", width: 180 },
        { prop: "payerName", label: "付款人名称", width: 120 },
        { prop: "payerBrno", label: "付款行行号", width: 120 },
        { prop: "amount", label: "金额", type: "price"},
        {
          prop: "oriBizCtgyCode",
          label: "业务种类",
          formatter(row, text, index) {
            return (
              (row["oriBizCtgyCode"] === null || row["oriBizCtgyCode"] === undefined ? "" : row["oriBizCtgyCode"]) +
              "-" +
              (row["oriBizCtgyCodeDesc"] === null || row["oriBizCtgyCodeDesc"] === undefined
                ? ""
                : row["oriBizCtgyCodeDesc"])
            );
          },
          width: 180,
        },
        { prop: "bizStatus", label: "业务状态", dictCode: "PROCESSSTATUS", width: 120 },
        {
          prop: "bizRejectCode",
          label: "业务拒绝处理码",
          formatter(row, text, index) {
            return (
              (row["bizRejectCode"] === null || row["bizRejectCode"] === undefined ? "" : row["bizRejectCode"]) +
              "-" +
              (row["bizRejectCodeDesc"] === null || row["bizRejectCodeDesc"] === undefined
                ? ""
                : row["bizRejectCodeDesc"])
            );
          },
          width: 180,
        },
        { prop: "payeeInName", label: "收款人客户结算名称", width: 180 },
        { prop: "payeeInActno", label: "收款人客户结算账号", width: 180 },
      ],

      dictMapAsync: {},
      // 弹出层标题
      title: "",
      restitle: "",
      papertitle: "",
      // 是否显示弹出层
      open: false,
      resopen: false,
      paperopen: false,
      // 表单参数
      detailForm: {},
      resdetailForm: {},
      paperdetailForm: {},
      totalRecord: 0,
      totalPage: 0,
      needCount: 0,
    };
  },
  mounted() {
    const formOptions = [
      // 普通搜索

      {
        type: "dates",
        nameObj: {
          startTimeName: "startcpgdate",
          endTimeName: "endcpgdate",
        },
        defaultAttr: {
          size: "small",
          label: "CPG日期",
          placeholder: ["请输入CPG开始日期", "请输入CPG结束日期"],
          format: "yyyy-MM-dd",
          valueFormat: "yyyyMMdd",
        },
      },

      {
        type: "dates",
        nameObj: {
          startTimeName: "startworkdate",
          endTimeName: "endworkdate",
        },
        defaultAttr: {
          size: "small",
          label: "工作日期",
          placeholder: ["请输入工作开始日期", "请输入工作结束日期"],
          format: "yyyy-MM-dd",
          valueFormat: "yyyyMMdd",
        },
      },

      {
        type: "input",
        prop: "id",
        defaultAttr: {
          size: "small",
          label: "交易流水号",
          placeholder: "请输入交易流水号",
        },
      },

      {
        type: "input",
        prop: "payeeActno",
        defaultAttr: {
          size: "small",
          label: "收款人账号",
          placeholder: "请输入收款人账号",
        },
      },

      {
        type: "input",
        prop: "batchNo",
        defaultAttr: {
          size: "small",
          label: "批序号",
          placeholder: "请输入批序号",
        },
      },
    ];
    this.formOptions = formOptions;
    this.dictMapAsync = this.getDictMap();
  },
  methods: {
    /***
     * 按钮操作汇总
     */
    /***
     * 按钮操作汇总
     */

    handleAction(type, row = {}) {
      switch (type) {
        case "detail":
          this.handleDetail(row);
          break;
      }
    },

    // 关闭按钮
    cancel() {
      this.open = false;
    },
    rescancel() {
      this.resopen = false;
    },
    papercancel() {
      this.paperopen = false;
    },
    /** 详情按钮操作 */
    handleDetail(row) {
      batchCollectionBusinessQueryDetail(row).then((response) => {
        this.title = "批量代收业务报文查询明细";
        this.detailForm = response.result;
        this.queryDetailParams.id = row.id;
        this.open = true;
      });
    },
    /** 应答详情按钮操作 */
    resDetail(row) {
      batchCollectionBusinessQueryReplyDetail(row).then((response) => {
        this.restitle = "批量代收业务报文查询应答明细";
        this.resdetailForm = response.result;
        this.resqueryDetailParams.id = response.result.id;
        this.resopen = true;
      });
    },
    // 批量代收业务付款人明细
    payerDetail(row) {
      batchCollectionBusinessQueryPayerDetail(row).then((response) => {
        this.papertitle = "批量代收业务付款人明细";
        this.paperdetailForm = row;
        this.paperopen = true;
      });
    },
  },
};
</script>

<style>
.label-header-msg {
  font-weight: bold;
}

.form-card {
  margin-bottom: 10px;
}
</style>
